<? if(!defined('IN_TIPASK')) exit('Access Denied'); include template(header,admin); ?>
<script type="text/javascript">
$(document).ready(function() {
$("#list").sortable({
update: function(){
var reorderid="";
var numValue=$("input[name='order[]']");
for(var i=0;i<numValue.length;i++){
reorderid+=$(numValue[i]).val()+",";
}
var hiddencid=$("input[name='hiddencid']").val();
$.post("index.php?admin_nav/reorder<?=$setting['seo_suffix']?>",{order:reorderid,hiddencid:hiddencid});
}
});
});
function removenav(nid){
if(confirm('删除该导航，确定继续?')){
window.location="index.php?admin_nav/remove/"+nid+"<?=$setting['seo_suffix']?>";
}
}
</script>
<div style="width:100%; height:15px;color:#000;margin:0px 0px 10px;">
  <div style="float:left;"><a href="index.php?admin_main/stat<?=$setting['seo_suffix']?>" target="main"><b>控制面板首页</b></a>&nbsp;&raquo;&nbsp;导航管理</div>
</div><? if(isset($message)) { $type=isset($type)?$type:'correctmsg';  ?><table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
<tr>
<td class="<?=$type?>"><?=$message?></td>
</tr>
</table><? } ?><table width="100%" cellspacing="1" cellpadding="4" align="center" class="tableborder">
<tbody><tr class="header"><td>导航列表&nbsp;&nbsp;&nbsp;<input onclick="document.location.href='index.php?admin_nav/add<?=$setting['seo_suffix']?>'" type="button" value="添加导航" /></td></tr>
<tr class="altbg1"><td>导航的排序可以通过鼠标拖动来改变，当鼠标在某一链接上面时，按住左键即可上下移动。</td></tr>
</tbody></table>
<table cellspacing="1" cellpadding="4" width="100%" align="center" style="border: 0 none !important; border-collapse: separate !important;empty-cells: show;margin-bottom: 0px;">
<tr class="header" align="center">
<td width="10%">名称</td>
<td width="30%">链接地址</td>
<td  width="20%">说明</td>
<td  width="10%">导航类型</td>
<td  width="8%">打开方式</td>
<td  width="7%">状态操作</td>
<td  width="5%">编辑</td>
<td  width="5%">删除</td>
</tr>
</table>
    <input type="hidden" name="hiddencid" value="<?=$pid?>" />
    <ul id="list" style="cursor: pointer;width:100%;float: right;" >
<? if(is_array($navlist)) { foreach($navlist as $nav) { ?>
<li style="list-style:none;">
<table  id="table1" cellspacing="1" cellpadding="4" width="100%" align="center" style="border: 0 none !important; border-collapse: separate !important;empty-cells: show;margin-bottom: 0px;"> 
<tr align="center" class="smalltxt">
<td width="10%" class="altbg1"><input name="order[]" type="hidden" value="<?=$nav['id']?>"/><a href="<?=$nav['url']?>" target="_blank"><?=$nav['name']?></a></td>
<td width="30%" align="center" class="altbg2"><a href="<?=$nav['url']?>" target="_blank"><?=$nav['url']?></a></td>
<td width="20%" align="center" class="altbg2"><?=$nav['title']?></td>
                                        <td width="10%" align="center" class="altbg2"><? if($nav['type']==1) { ?><font color="orange">站内导航</a><? } else { ?>站外导航<? } ?></td>
<td width="8%" align="center" class="altbg1"><? if($nav['target']) { ?>新窗口<? } else { ?>本窗口<? } ?></td>
<td width="7%" align="center" class="altbg2"><a href="index.php?admin_nav/available/<?=$nav['id']?>/<?=$nav['available']?><?=$setting['seo_suffix']?>"><? if($nav['available']) { ?>点击禁用<? } else { ?><font color="green">点击启用</font><? } ?></a></td>
<td width="5%" align="center" class="altbg1"><img src="css/admin/edit.png" onclick="document.location.href='index.php?admin_nav/edit/<?=$nav['id']?><?=$setting['seo_suffix']?>'"></td>
<td width="5%" align="center" class="altbg2"><img src="css/admin/remove.png" onclick="removenav(<?=$nav['id']?>)"></td>
</tr>
</table>
</li>
<? } } ?>
</ul>
<br>
<? include template(footer,admin); ?>
